package com.bancj.demo1.entity;

/**
 * Ajax 调用时放回的对象
 *
 * @author yangfan
 */
public class AjaxResult {
    private boolean result;
    private String info;
    private Object obj;

    public void success() {
        this.result = true;
    }

    public void success(String info) {
        this.result = true;
        this.info = info;
    }

    public void success(Object object) {
        this.result = true;
        this.obj = object;
    }

    public void success(String info, Object object) {
        this.result = true;
        this.info = info;
        this.obj = object;
    }

    public void error() {
        this.result = false;
    }

    public void error(String info) {
        this.result = false;
        this.info = info;
    }

    public void error(String info, Exception e) {
        this.result = false;
        this.info = info + "-" + e.getMessage();
    }

    public void error(String info, Object object) {
        this.result = false;
        this.info = info;
        this.obj = object;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
}